home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 25
/
CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso
/
CUCD
/
Programming
/
jpeglibrary
/
includes
/
jpeg
/
jpeg.h
< prev
Wrap
C/C++ Source or Header
|
1998-05-26
|
5KB
|
129 lines
#ifndef JPEG_H
#define JPEG_H
/*
** $VER: jpeg.h 1.0 (2.5.98)
**
** Public structures and defintions for jpeg.library.
**
** © Paul Huxham
**
** This software is based in part on the work of
** the Independent JPEG Group.
*/
#ifndef EXEC_TYPES_H
#include "exec/types.h"
#endif
#ifndef DOS_DOS_H
#include <dos/dos.h>
#endif
#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif
/* Used for JPEG decompression */
struct JPEGDecHandle
{
ULONG ptr; // Private!
};
/* Used for JPEG compression */
struct JPEGComHandle
{
ULONG ptr; // Private!
};
/*========================================================================*/
/* The decompress hook is called once for each scanline in the image.
a0 contains a UBYTE pointer to the scanline to copy
d0 contains a ULONG with the scanline number of this data (1 being
first scanline)
d1 contains a ULONG with the number of bytes in this row
a1 contains the userdata
If the hook returns a non NULL value, the decoding will be aborted -
You should NOT call any functions other than FreeJPEGDecompress() on
that jpeg object.
*/
typedef ULONG (*JPGD_HOOK)( void *, ULONG, ULONG, void * );
typedef __asm ULONG (*JPGD_HOOK_PROTO)( register __a0 void *, register __d0 ULONG, register __d1 ULONG, register __a1 void * );
/* The compress hook is called once for each scanline in the image.
a0 contains a UBYTE **. Copy into here (*ptr=) the pointer to the image
d0 contains a ULONG with the scanline number of the scanline I want
d1 contains a ULONG with the width of the image
a1 contains the userdata
If the hook returns a non NULL value, the encoding will be aborted -
You should NOT call any functions other than FreeJPEGCompress() on
that jpeg object.
*/
typedef ULONG (*JPGC_HOOK)( UBYTE **, ULONG, ULONG, void * );
typedef __asm ULONG (*JPGC_HOOK_PROTO)( register __a0 UBYTE **, register __d0 ULONG, register __d1 ULONG, register __a1 void * );
/*========================================================================*/
/* Colour space defines, from JPG_ColourSpace */
enum
{
JPCS_UNKNOWN, // Error/unspecified
JPCS_GRAYSCALE, // Monochrome
JPCS_RGB, // Red/green/blue
JPCS_YCbCr, // Y/Cb/Cr (also known as YUV)
JPCS_CMYK, // C/M/Y/K
JPCS_YCCK // Y/Cb/Cr/K
};
/*========================================================================*/
/* Jpeg tagbase */
#define JPG_TB ( TAG_USER + 0x80000 )
/* Jpeg tags */
#define JPG_SrcMemStream JPG_TB + 1 /* Pointer to stream data in memory (UBYTE *) */
#define JPG_SrcMemStreamSize JPG_TB + 2 /* Length in bytes of data stream (ULONG) */
#define JPG_DestMemStream JPG_TB + 3 /* Pointer to a pointer to created data in memory (UBYTE **) */
#define JPG_DestMemStreamSize JPG_TB + 4 /* Pointer to take size of created data (ULONG *) */
#define JPG_SrcFile JPG_TB + 5 /* Pointer to an open file (BPTR) */
#define JPG_DestFile JPG_TB + 6 /* Pointer to an open file (BPTR) */
#define JPG_DestRGBBuffer JPG_TB + 7 /* Pointer to a memory block (UBYTE *) */
#define JPG_DecompressHook JPG_TB + 8 /* Pointer to a function to store scan lines */
#define JPG_DecompressUserData JPG_TB + 9 /* Pointer to user data (void *) */
#define JPG_SrcRGBBuffer JPG_TB + 12 /* Pointer to a memory block (UBYTE *) */
#define JPG_CompressHook JPG_TB + 13 /* Pointer to a function to store scan lines */
#define JPG_CompressUserData JPG_TB + 14 /* Pointer to user data (void *) */
/* Jpeg tags affecting image size and quality */
#define JPG_ScaleNum JPG_TB + 10 /* Numerator for scaling (ULONG) */
#define JPG_ScaleDenom JPG_TB + 11 /* Denomenator for scaling (ULONG) */
#define JPG_Width JPG_TB + 20 /* Width of image in pixels (ULONG *) */
#define JPG_Height JPG_TB + 21 /* Height of image in pixels (ULONG *) */
#define JPG_BytesPerPixel JPG_TB + 22 /* Number of bytes per image pixel (ULONG *) */
#define JPG_RowSize JPG_TB + 23 /* Size of one row (ULONG *) [GET only] */
#define JPG_ColourSpace JPG_TB + 24 /* Type of image data (UBYTE *) */
#define JPG_Quality JPG_TB + 25 /* Save quality of jpeg (1-100) () */
#define JPG_Smoothing JPG_TB + 26 /* Save smoothing amount (0-100) () */
/*========================================================================*/
/* Defined error return codes */
#define JPGERR_NONE 0 /* No error */
#define JPGERR_NOMEMORY 1 /* Insufficient memory */
#define JPGERR_NOHANDLE 2 /* No jpeg handle supplied */
#define JPGERR_CREATEOBJECT 3 /* Failed to create JPEG object */
#define JPGERR_DECOMPFAILURE 4 /* Failed to decompress */
#define JPGERR_NOSRCSTREAM 5 /* No source stream to decode */
#define JPGERR_NODESTBUFFER 6 /* No destination rgb buffer/hook */
#define JPGERR_DECOMPABORTED 7 /* Decompression aborted by user hook */
#define JPGERR_NODESTSTREAM 8 /* No destination stream pointers */
#define JPGERR_COMPFAILURE 9 /* Failed to compress */
#define JPGERR_COMPABORTED 10 /* Compression aborted by user hook */
#define JPGERR_NOIMAGESIZE 11 /* No image size supplied */
#define JPGERR_ALREADYDECOMP 12 /* Handle has already been decompressed */
#define JPGERR_ALREADYCOMP 13 /* Handle has already been compressed */
#endif /* JPEG_H */